public class Changing0s{
  public void changing(int[][] matrix){
    boolean[] rows = new boolean[matrix.length];
    boolnea[] cols = new boolean[matrix[0].length];
    
    for(int y = 0; y < matrix.length; y++){
      for(int x = 0; x < matrix[0].length; x++) {
        if(matrix[y][x] == 0) {
          rows[y] = true;
          cols[x] = true;
        }
      }
    }
    
    for(int y = 0; y < matrix.length; y++){
      for(int x = 0; x < matrix[0].length; x++){
        if(rows[y] == true || cols[x] == true)
          matrix[y][x] = 0;
      }
    }
  }
}